home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
libs
/
gadutil.lha
/
GadUtil
/
docs
/
01.GU_PreliminaryDocs
next >
Wrap
Text File
|
1995-06-26
|
17KB
|
432 lines
GadUtil tags
~~~~~~~~~~~~~~
Tags to use for the yet undocumented function GU_LayoutGadgetsA().
Tags to use in the tag lists for each gadget to create. Note that
you do not have to specify any tags that not change from gadget to
gadget.
GU_GadgetKind (ULONG)
Can be any of the standard GadTools gadget kinds, or one of the
extensions provided by GadUtil. Currently extended types are:
IMAGE_KIND
A gadget that uses an Intuition Image structure for its
contents. Selected and unselected states can use different
images. The images are centered automatically.
Extra tags for IMAGE_KIND:
GUIM_Image (struct Image *)
Image for the gadget in its unselected state. This is
the only required (extra) tag for IMAGE_KIND gadgets.
GUIM_SelectImg (struct Image *)
Image for the gadget in its selected state. If this tag
is omitted, the selected image will be the same as the
unselected, and only the border and the background color
will change (depending on the GUIM_BOOPSILook tag).
GUIM_ReadOnly (BOOL)
TRUE to create a read-only image gadget.
GUIM_BOOPSILook (BOOL)
This tag will allow the programmer to select how the
secondary image should be shown, if only one image is
used for the gadget. Defaults to TRUE, which means that
the background color will change when the user selects
the gadget.
DRAWER_KIND
A "select drawer" image button. This can be used to select
a path, but is often used to select files.
FILE_KIND
A "select file" image button. This can be used to allow the
user to select a file. Most programs uses the DRAWER_KIND
for both file and path selection.
BEVELBOX_KIND
A GadTools bevelbox. Use this to avoid the use of absolute
sizing of bevelboxes. All bevel box kinds from OS3.0 is
supported, even if the computer only has OS2.0.
Extra tags for BEVELBOX_KIND:
GUBB_Recessed (BOOL)
Create a recessed ("pushed in") bevel box. Differs from
the GadTools tag GTBB_Recessed, in that it works with
both TRUE and FALSE as parameter. GadTools creates a
recessed box independent from the given value.
Defaults to FALSE.
GUBB_FrameType (ULONG)
Determines what kind of box this function renders. The
current available alternatives are:
BFT_BUTTON - Generates a box like what is used around
a GadTools BUTTON_KIND gadget.
BFT_RIDGE - Generates a box like what is used around
a GadTools STRING_KIND gadget.
BFT_DROPBOX - Generates a box suitable for a standard
icon drop box imagery.
BFT_HORIZBAR - Generates a horizontal shadowed line.
Can also be used to draw a normal line,
using 1 for the line's height.
BFT_VERTBAR - Generates a vertical shadowed line. Can
also be used to draw a normal line, using
1 for the line's width.
Defaults to BFT_BUTTON.
GUBB_TextColor (ULONG)
Selects which color to print the title text in. Only useful
for a bevelbox with a title. Defaults to the color of the
TEXTPEN.
GUBB_TextPen (ULONG)
Selects which pen to print the title text in. Only
useful for a bevelbox with a title. Defaults to TEXTPEN.
This tag overrides the GUBB_TextColor tag.
GUBB_Flags (ULONG)
Currently, only text placement flags are defined. These are:
Y-pos flags
~~~~~~~~~~~
BB_TEXT_ABOVE - Places the bevel box text above the upper
border of the box ___Example___
BB_TEXT_IN - Places the bevel box text at the upper
border of the box ---Example---
BB_TEXT_BELOW - Places the bevel box text below the upper
border of the box ___ ___
Example
X-pos flags
~~~~~~~~~~~
BB_TEXT_CENTER - Places the bevel box text in the middle
of the upper border ---Example---
BB_TEXT_LEFT - Places the bevel box text 8 pixels from
the left edge of the box -Example-----
BB_TEXT_RIGHT - Places the bevel box text 8 pixels from
the right edge of the box -----Example-
Default if BB_TEXT_ABOVE!BB_TEXT_CENTER. Combine the x and y
position flags by OR:ing them together. Don't combine two X
or two Y flags together.
Changed tags, and additions to GadTools:
LISTVIEW_KIND:
GTLV_ShowSelected (UWORD id)
This tag was changed, so that you don't have to create the
string gadget before all other gadgets. The difference from
this tag in GadTools, is that we now have to give the ID of
the string gadget to use to show the selected item.
An example of a valid (and probably most useful) gadget to
use for GTLV_ShowSelected:
ShowSelGad:
dc.l GU_GadgetKind, STRING_KIND, GU_AutoHeight, 4
dc.l GU_DupeWidth, GAD_LISTVIEW, GU_GadgetText, NULL
dc.l TAG_DONE
This gadget MUST be before the LISTVIEW gadget in the LayoutGadget
array.
Special:
ti_Data = -1 Creates a read-only gadget below the listview,
same as for GTLV_ShowSelected, 0 for GadTools.
ti_Data = x Gadget ID for the gadget that the selected item
should be displayed in. Same as GadTools reaction
on a gadget pointer in ti_Data.
This gadget's ti_Data field will be changed during the creation
of the gadget, but will be changed back before GU_LayoutGadgets
returns.
MX_KIND:
The gng_GadgetText field in the NewGadget structure can be used even
with MX_KIND gadgets. This should have been included in GadTools.
The gadget text will always be placed ABOVE the gadget, on the same
side as the other texts for the gadget. Positions are checked against
WBPattern & SerialPrefs to get them "right". The GU_GadgetText and
GU_LocaleText tags are used to access this field.
Tags for all gadget kinds:
Gadget width control:
GU_Width (UWORD wid)
Absolute width of the gadget. Not recommended to use for other
gadgets than IMAGE_KIND, DRAWER_KIND and FILE_KIND.
GU_DupeWidth (UWORD id)
Duplicate the width of another gadget.
GU_AutoWidth (WORD add)
Width = length of text label + ti_Data. This tag doesn't work
as it should with CYCLE_KIND and MX_KIND gadgets. Will be fixed
later. Use GU_Columns for those kinds until this is fixed.
GU_Columns (UWORD numcols)
Set the gadget width so that approximately ti_Data columns of
text will fit.
GU_AddWidth (WORD add)
Add ti_Data to the total width calculation.
GU_MinWidth (UWORD wid)
Make the gadget at least ti_Data pixels wide.
GU_MaxWidth (UWORD wid)
Make the gadget at most ti_Data pixels wide.
GU_AddWidChar (WORD chars)
Add the length of ti_Data characters to the total width calculation.
Gadget height control:
GU_Height (UWORD hei)
Absolute height of the gadget. Not recommended to use for other
gadgets than IMAGE_KIND, DRAWER_KIND and FILE_KIND.
GU_DupeHeight (UWORD id)
Duplicate the height of another gadget.
GU_AutoHeight (WORD add)
Height = height of the gadget's font + ti_Data. This tag doesn't
work as it should with MX_KIND gadgets. Will be fixed later.
Use GU_HeightFactor or GU_Height for MX_KIND until this is fixed.
GU_HeightFactor (UWORD numlines)
Set the gadget height to approximately ti_Data lines.
GU_AddHeight (WORD add)
Add ti_Data to the total height calculation.
GU_MinHeight (UWORD wid)
Make the gadget at least ti_Data pixels high.
GU_MaxHeight (UWORD wid)
Make the gadget at most ti_Data pixels high.
GU_AddHeiLines (WORD numlines)
Add the height of ti_Data/2 lines to the final height calculation.
The numlines argument is given in units of 1/2 lines to get
better resolution (ti_Data of 4 means that the height of 2
lines should be added).
Gadget top edge control:
GU_Top, GU_TopRel and GU_AlignTop locks the top edge of the gadget, and
allows any bottom edge control tag to adjust the height, so that both
top and bottom edges will be correct.
GU_Top (UWORD ypos)
Absolute top edge of the gadget. Not recommended to use for other
gadgets than the top-most gadgets.
GU_TopRel (UWORD id)
Make the top edge relative to another gadgets bottom edge. This
gadget will be placed BELOW the given gadget.
GU_AddTop (WORD add)
Add ti_Data to the final top edge calculation.
GU_AlignTop (UWORD id)
Align the top edge of the gadget with another gadgets top edge.
GU_AdjustTop (WORD add)
Add the height of the text font + ti_Data to the top edge.
GU_AddTopLines (WORD numlines)
Add the height of ti_Data/2 lines to the final top edge. The
numlines argument is given in units of 1/2 lines to get better
resolution (ti_Data of 4 means that the height of 2 lines
should be added).
Gadget bottom edge control:
GU_Bottom, GU_BottomRel and GU_AlignBottom locks the bottom edge of the
gadget, and allows any top edge control tag to adjust the height, so that
both top and bottom edges will be correct.
GU_Bottom (UWORD ypos)
Absolute bottom edge of the gadget. Not recommended to use for other
gadgets than the bottom-most gadgets. Should not be necessary to use
at all.
GU_BottomRel (UWORD id)
Make the bottom edge relative to another gadgets top edge. This
gadget will be placed ABOVE the given gadget.
GU_AddBottom (WORD add)
Add ti_Data to the final bottom edge calculation.
GU_AlignBottom (UWORD id)
Align the bottom edge of the gadget with another gadgets bottom edge.
GU_AdjustBottom (WORD add)
Subtract the height of the gadget's font + ti_Data from the top edge.
This will move the gadget UPWARDS (ti_Data + font height) pixels.
Gadget left edge control:
GU_Left, GU_LeftRel and GU_AlignLeft locks the left edge of the gadget,
and allows any right edge control tag to adjust the width, so that both
left and right edges will be correct.
GU_Left (UWORD xpos)
Absoulute left edge of the gadget. Not recommended to use for other
gadgets than the left-most gadgets.
GU_LeftRel (UWORD id)
Make the left edge relative to another gadgets right edge. This
gadget will be placed TO THE RIGHT of the given gadget.
GU_AddLeft (WORD add)
Add ti_Data to the final left edge calculation.
GU_AlignLeft (UWORD id)
Align the left edge of the gadget with another gadgets left edge.
GU_AdjustLeft (WORD add)
Add the width of the gadget label + ti_Data to the left edge.
GU_AddLeftChar (WORD chars)
Add the length of ti_Data characters to the left edge.
Gadget right edge control:
GU_Right, GU_RightRel and GU_AlignRight locks the right edge of the
gadget, and allows any left edge control tag to adjust the width, so
that both left and right edges will be correct.
GU_Right (UWORD xpos)
Absoulute right edge of the gadget. Not recommended to use for other
gadgets than the right-most gadgets. Should not be necessary to use
at all.
GU_RightRel (UWORD id)
Make the right edge relative to another gadgets left edge. This
gadget will be placed TO THE LEFT of the given gadget.
GU_AddRight (WORD add)
Add ti_Data to the final right edge calculation.
GU_AlignRight (UWORD id)
Align the right edge of the gadget with another gadgets right edge.
GU_AdjustRight (WORD add)
Add the width of the gadget label + ti_Data to the left edge.
Other tags:
GU_ToggleSelect (BOOL)
Create a toggle select gadget. Works with BUTTON_KIND and IMAGE_KIND
gadgets.
GU_Selected (BOOL)
Set the initial value of a toggle select gadget.
GU_Hotkey (CHAR)
Hotkey that should simulate a press (release) of a gadget.
GU_HotkeyCase (BOOL)
Make the hotkey case-sensitive. Default is not case sensitive.
GU_LabelHotkey (BOOL)
Get the hotkey directly from the gadget's label. The hotkey can
be case-sensitive, but not for CYCLE, LISTVIEW and MX gadgets.
GU_RawKey (BYTE)
Use a rawkey as a gadget hotkey. May not be case-sensitive.
Tags that gives access to other fields in the NewGadget structure:
GU_GadgetText (UBYTE *)
A pointer to the gadget's label. Will be copied directly into the
gng_GadgetText field of the NewGadget structure.
GU_TextAttr (struct TextAttr *)
A pointer to an initialized TextAttr structure (to select the font).
Will be copied directly into the gng_TextAttr field of the NewGadget
structure.
GU_Flags (ULONG)
Gadget flags. Currently available flags are as for GadTools, but
here is a short list of them:
PLACETEXT_LEFT - Place the gadget label right aligned on the left
side of the gadget.
PLACETEXT_RIGHT - Place the gadget label left aligned on the right
side of the gadget.
PLACETEXT_ABOVE - Place the gadget label centered above the gadget.
PLACETEXT_BELOW - Place the gadget label centered below the gadget.
PLACETEXT_IN - Place the gadget label centered inside the gadget.
NG_HIGHLABEL - Highlight the label (render it using SHINEPEN).
GU_UserData (APTR)
Storage for your own data. Will probably be removed, since GadUtil
uses this filed for an internal structure (with some external
available fields).
GU_LocaleText (ULONG stringid)
Get gadget label from a catalog. This allows easy localization of
all new programs.
Tags that should be passed directly to GU_LayoutGadgetsA():
GU_RightExtreme (ULONG *)
A pointer to a longword that is used to store the rightmost point
that a gadget will exist in.
GU_LowerExtreme (ULONG *)
A pointer to a longword that is used to store the lowermost point
that a gadget woll exist in.
GU_Catalog (struct Catalog *)
A pointer to the programs translation catalog. NULL indicates that
the program should use the internal strings. You must open the
catalog by yourself (use GU_OpenCatalog() or locale/OpenCatalog).
The GU_AppStrings tag MUST be used together with this tag.
GU_DefTextAttr (struct TextAttr *)
Specifies the default font to use with all gadgets. Can be over-
ridden with GU_TextAttr tag for each gadget.
GU_AppStrings (struct AppString *)
A pointer to an array of AppString structures. These strutures
contains the programs internal strings.
This tag must be used together with the GU_Catalog tag.
GU_BorderLeft (ULONG)
Size of the window's left border.
GU_BorderTop (ULONG)
Size of the window's top border.
GU_NoCreate (BOOL)
Don't create any gadgets. Useful to determine if the window will
fit on the screen etc.